<!DOCTYPE html>
<html lang="en" xmlns: xmlns:th="http://www.thymeleaf.org">
<head th:include="common/admin/common::common_head">
    <title>管理员首页</title>
</head>
<body class="cm-no-transition cm-1-navbar">
<div th:include="common/admin/common::common_footer_script"/>
<!--后台公共侧边栏（菜单）-->
<div th:replace="common/admin/common::common_siderbar"></div>
<!--后台公共顶部-->
<div th:replace="common/admin/common::common_top"></div>
<div id="global">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">评估</div>
                    <table class="table">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>真实姓名</th>
                            <th>身份证</th>
                            <th>月收入</th>
                            <th>信用分</th>
                            <th>额度</th>
                            <th>车辆信息</th>
                            <th>房产信息</th>
                            <th>审批</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr class="active" th:each="entry:${limitlist}">
                            <th scope="row" th:text="${entry.id}"></th>
                            <td th:text="${entry.name}"></td>
                            <td th:text="${entry.idcard}"></td>
                            <td th:text="${entry.monthincome}"></td>
                            <td th:text="${entry.Creditpoints}"></td>
                            <td th:text="${entry.limits}"></td>
                            <td>
                                <div class="btn-group" role="group">
                                    <a class="btn btn-info get-action" id="showModal" th:href="@{/loan/back-make/selmodalapply(id=${entry.id},applyMType='车辆')}"
                                       type="button">
                                        <i class="fa fa-fw fa-search-plus"></i>
                                    </a>
                                </div>
                            </td>
                            <td>
                                <div class="btn-group" role="group">
                                    <a class="btn btn-info get-action" th:href="@{/loan/back-make/selmodalapply(id=${entry.id},applyMType='房产')}" type="button">
                                        <i class="fa fa-fw fa-search-plus"></i>
                                    </a>
                                </div>
                            </td>
                            <td>
                                <a class="btn btn-success" onclick='makesubmit(id)' th:id="tony+${entry.id}" th:value="${entry.id}">同意</a>
                                <!--<div><a href="#"><span style="visibility:hidden">我的</span></a></div>-->
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <ul class="pagination" style="margin-left: 500px">
            <li><a th:href="@{/loan/back-make/tolimit(currPage=1)}">&laquo;</a></li>
            <li><a th:href="@{/loan/back-make/tolimit(currPage=${pager.currPage-1})}">&lt;</a></li>
            <!--<li th:each="pp:${pager.totalPage}"><a href="#" th:text="${pp}">1</a></li>-->
            <li th:each="pagenum:${#numbers.sequence(1,pager.totalPage)}">
                    <span th:if="${pagenum} != 0">
                        <a th:href="@{/loan/back-make/tolimit(currPage=${pagenum})}" th:text="${pagenum}"></a>
                    </span>
            </li>
            <li><a th:href="@{/loan/back-make/tolimit(currPage=${pager.currPage+1})}">&gt;</a></li>
            <li><a th:href="@{/loan/back-make/tolimit(currPage=${pager.totalPage})}">&raquo;</a></li>
        </ul>
    </div>
    <div class="modal fade" id="myModal" tabindex="-1">
        <div class="modal-dialog modal-md"><!--modal-sm 设置模态框尺寸-->
            <div class="modal-content">

                <div class="modal-header">
                    <button class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">金额审批</h4>
                </div>
                <div class="modal-body">
                    <form id="loginform">
                        <input id="makeid" name="id" type="hidden"/>
                        <div class="form-group">
                            <label>评估金额</label>
                            <input class="form-control" id="maxmoney" name="maxmoney" placeholder="请输入金额" type="text"/>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <font color="red" id="msg"></font>
                    <input id="submitUrl" type="hidden"/>
                    <button class="btn btn-primary" onclick="makeupd()">提交</button>
                    <button class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
    <footer class="cm-footer"><span class="pull-left">Connected as John Smith</span><span class="pull-right">&copy; PAOMEDIA SARL</span></footer>
</div>
<script>
    $("#inmoney").css('display', 'none');

    function makesubmit(age) {
        //提交审核结果url
        var submitUrl = age;
        $('#submitUrl').val(submitUrl);//给会话中的隐藏属性URL赋值
        $('#myModal').modal();
    }

    function makeupd() {
        var maxmoney = $('#maxmoney').val();
        var submitUrl = $.trim($("#submitUrl").val());//获取会话中的隐藏属性URL
        var intid = $("#" + submitUrl + "").attr("value");
        $.post("[[@{/loan/back-make/updlimit}]]", {id: intid, limitmoney: maxmoney}, function (data) {
            window.location.reload();
        }, "text")

    }
</script>
<!--<script th:replace="common/admin/common::common_footer"></script>-->
<script th:src="@{/admin/assets/js/demo/home.js}"></script>
</body>
</html>
